In image encoding such as compression of a moving image, motion vectors are detected, and a data compression process based on motion vector information is executed. In the MPEG system known as an image encoding system, for example, a process of dividing each frame into blocks and detecting a motion vector for each of the corresponding blocks of the current frame and the reference frame is executed. However, when motion vector information in block units is included in compression data, the data volume increases. When a camera is moved by, for example, panning, tilting, hand shaking, or the like, the most motion vectors of the respective blocks are common. In such a case, it is possible to reduce the data volume by setting not motion vectors in block units but a single motion vector corresponding to a single frame and performing an encoding process.
The individual motion vectors in block units are referred to as local motion vectors (LMV), and the single motion vector corresponding to the single frame is referred to as a global motion vector (GMV). Data encoding using the global motion vector (GMV) is employed in, for example, MPEG-4.
For example, as shown in FIG. 1A, there are two frame images 10 and 11 which are photographed at times t0 and t1. The two frames are frames which are photographed by moving a camera through for example panning, tilting, hand shaking, or the like, and a photographed image is moved as a whole as shown in the drawing.
When such an image is encoded, each frame is divided into, for example, a plurality of blocks of n pixels×n pixels. Conventionally, by detecting the motion vectors (MV) in respective block units, that is, the local motion vectors (LMV), data compression and restoration processes using the individual motion vectors in block units has been performed. However, when a camera is moved through panning, tilting, hand shaking, or the like, as shown in FIG. 1B, the motion vectors of any and every block become substantially the same vectors.
In such a case, as shown in FIG. 1C, by executing the image encoding using a single motion vector 21 which represents a motion of the entire screen, it is possible to greatly improve encoding efficiency. Such a vector, which represents the motion of the entire screen, is referred to as a global motion vector (GMV).
The global motion vector (GMV) can be represented as data which uses affine transformation and projection shadow transformation accompanied with not only simple parallel movement but also rotation, enlargement, and reduction by using a plurality of parameters, as shown in the drawing. As described above, as the encoding method to which the global motion vector (GMV) is applied, MPEG-4 or the like is employed.
In MPEG-4, the global motion vector (GMV) is applied, the image encoding method using global motion compensation (GMC) is employed as a standard, the global motion vector (GMV) is detected on the encoding device (Encoder) side, and restoration based on the global motion compensation (GMC) is executed by using the global motion vector (GMV) which is transferred from the decoding device (Decoder) side.
The global motion vector (GMV) is represented as data which uses parallel movement, rotation, enlargement, reduction, affine transformation, projection shadow transformation, and the like in a relationship of corresponding similar pixel positions (x, y) and (x′, y′) between the current frame and the reference frame as shown in FIG. 2, and normally a single global motion vector (GMV) is applied to a single frame image. It should be noted that a screen may be divided into pieces each having a size larger than, for example, a normal block size, and the global motion vectors (GMV) may be set for the respective pieces. That is, the number of the global motion vectors (GMV) is not limited to one for a frame image, and it may be possible to adopt a configuration in which a single global motion vector (GMV) as a common motion vector is set for a plurality of blocks included in the frame image or a plurality of global motion vectors (GMV) is set for a single frame.
In the case of a vector representing only for example parallel movement (translation), the global motion vector (GMV) is represented as follows by using two parameters [a0, a1].x′=x+a0 y′=y+a1 
The global motion vector (GMV), in which parallel movement (translation) and rotation are considered, is represented as follows by using three parameters [a0, a1, a2].x′=sin a0x−cos a0y+a2 y′=cos a0x+sin a0y+a3 
The global motion vector (GMV), which is compliant with affine transformation, is represented as follows by using six parameters [a0, a1, a2, a3, a4, a5].x′=a0x−a1y+a2 y′=a3x+a4y+a5 
The global motion vector (GMV), which is compliant with projection transformation, is represented as follows by using eight parameters [a0, a1, a2, a3, a4, a5, a6, a7].x′=((a0x+a1y+a2)/(a6x+a7y+1))y′=((a3x+a4y+a5)/(a6x+a7y+1))
In a case of obtaining the global motion vector (GMV) from a moving image frame, as shown in FIG. 2, a process using a current frame and a reference frame is executed. The reference frame is photographed at for example a certain time previous or subsequent to the current time. As the method of obtaining the global motion vector (GMV), there are several methods. However, as one of the methods, there is a method of first obtaining the local motion vectors (LMV) in block units, which are divided regions of a frame image, and obtaining the global motion vector (GMV) by using the local motion vectors (LMV).
The method is a method of first obtaining the local motion vectors (LMV) in block units, selecting the local motion vectors (LMV) with high degrees of reliability from a plurality of local motion vectors (LMV) corresponding to the number of blocks, and obtaining a single global motion vector (GMV) on the basis of only the selected local motion vectors (LMV) with high degrees of reliability.
For example, in a case where p local motion vectors (LMV) corresponding to the number of p blocks is obtained, q local motion vectors (LMV) with high degrees of reliability are selected from p local motion vectors, and a single global motion vector (GMV) is obtained on the basis of only m local motion vectors (LMV) with high degrees of reliability, without using (p-q) local motion vectors (LMV) with low degrees of reliability.
As the reliability information of the local motion vectors (LMV), information as to whether or not it is possible to obtain clear feature point matching information through for example block matching between the current frame and the reference frame is used. Further, as the method of obtaining the single global motion vector (GMV) on the basis of the local motion vectors (LMV) with high degrees of reliability, for example, a least-squares method is applied.
A method of deriving the global motion vector (GMV) using the local motion vectors (LMV) is advantageous in that it can be executed as an extension of conventional local motion vector (LMV) calculation and the existing configuration can be used. However, there is a disadvantage in that, when the number of local motion vectors (LMV) with high degrees of reliability is small, the degree of reliability of the global motion vector (GMV) is extremely lowered.
As one proposal to solve the disadvantage, there is a technique disclosed in PTL 1 (Japanese Unexamined Patent Application Publication No. 2009-65332).
PTL 1 discloses, for example, a method of obtaining an average value of the local motion vectors (LMV) corresponding to the blocks, which are divided regions of a frame image constituting a moving image, and comparing with the average value.
However, when various different local motion vectors (LMV) are set in a certain image region, incidentally, the average value may become a vector approximate to a vector of a target block. In such a case, there is a problem in that exact processes may not be performed as the situation demands.